package easy;

import java.util.ArrayList;
import java.util.List;

public class Solution_1431 {

    public List<Boolean> kidsWithCandies(int[] candies, int extraCandies) {
        List<Boolean> list = new ArrayList<>(candies.length);
        int max = 0;
        for (int candy : candies) {
            if (candy > max) {
                max = candy;
            }
        }
        for (int candy : candies) {
            if ((candy + extraCandies) >= max) {
                list.add(Boolean.TRUE);
            } else {
                list.add(Boolean.FALSE);
            }
        }
        return list;
    }

    public static void main(String[] args) {
        Solution_1431 model = new Solution_1431();
        System.out.println(model.kidsWithCandies(new int[]{2, 3, 5, 1, 3}, 3));
        System.out.println(model.kidsWithCandies(new int[]{4, 2, 1, 1, 2}, 1));
        System.out.println(model.kidsWithCandies(new int[]{12, 1, 12}, 10));
    }
}
